import java.util.Scanner;

/**
 *  阶乘计算
 */
public class FactorialCalculation {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[5000];
        a[0] = 1;
        int r = 0; //进制位
        for (int i = 1 ; i <= n ; i++){
            for (int j = 0 ; j < 5000 ; j++){
                r = a[j] * i + r;
                a[j] = r % 10;
                r = r/10;
            }
        }
        int s = 0;
        for (int i = 4999 ; i >= 0 ; i--){
            if (a[i] != 0){
                System.out.print(a[i]);
                s = i;
                break;
            }
        }
        for (int i = s-1 ; i >= 0 ; i--){
                System.out.print(a[i]);
        }
    }
}
